<?php
/**
 * Created by PhpStorm.
 * User: deng
 * Date: 2016/4/29
 * Time: 10:55
 */
class ChatRoom extends AdminBase{

    protected $do;

    function __construct(){
        parent::__construct();
        $this->do = 'getChatRoomData';
        $this->{$this->op}();
    }

    function indexAction(){
        include_once template("admin_v2/chatroom");
        exit();
    }

    function listAction(){
        $this->fetchData(array_merge([
            'do'     => $this->do,
            'format' => 'json',
            'action' => 'getChatRooms',
            'category' => 2,
        ], $this->req));
    }

    function closeAction(){
        $this->fetchData([
            'do'     => $this->do,
            'format' => 'json',
            'action' => 'disbandChatRoom',
            'rid' => $this->req['rid'],
        ]);
    }

    function editdetailAction(){
        $this->req['dateline'] = strtotime($this->req['dateline']);
        $this->fetchData(array_merge([
            'do'     => $this->do,
            'format' => 'json',
            'action' => 'modifyChatRoom',
        ], $this->req));
    }


}
new ChatRoom;